//
//  SelfSizeTool.m
//  10-CellSelfSize
//
//  Created by 李昊林 on 16/7/27.
//  Copyright © 2016年 李昊林. All rights reserved.
//

#import "SelfSizeTool.h"

@implementation SelfSizeTool
+ (CGFloat)selfSizeWithString:(NSString *)string
                        width:(CGFloat )width
                        font:(UIFont *)font {
     CGRect newRect = [string boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil];
    return newRect.size.height;
}

@end
